//
//  photoBigView.m
//  jiajiao
//
//  Created by apple on 16/4/14.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "photoBigView.h"
@interface photoBigView()
@property(nonatomic,strong)UIImageView *imageview;
@property(nonatomic,strong)UIImage *image;
@end
@implementation photoBigView
-(instancetype)init
{
    if (self = [super init]) {
        self.imageview = [[UIImageView alloc]init];
        [self addSubview:self.imageview];
       self.backgroundColor= kcolor(10, 10, 10, 1);
    }
    return self;
}
-(void)setImage:(UIImage *)image
{
    _image = image;
   CGSize size = [Unit getHightWith:image Width:KscrW];
    self.imageview.frame = CGRectMake(0, (self.height-size.height)/2, KscrW, size.height);
    self.imageview.image=image;
}
+(void)showbigimage:(UIImage *)image;
{
 UIWindow *window =  [UIApplication sharedApplication].keyWindow;
    
    photoBigView *photo = [[photoBigView alloc]init];
    photo.frame = KmainScreen;
    photo.image=image;
    [window addSubview:photo];
    
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self removeFromSuperview];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
